/*
 *  This file is part of "SchoolChoice",
 *  a school registration system.
 *
 *  Copyright (C) 2009 Nicolas Decerf, Olivier Jacquemin.
 *
 *  "SchoolChoice" is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  "SchoolChoice" is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program: see the file COPYING.txt.  If not, see
 *  http://www.gnu.org/licenses/.
 */

package be.schoolchoice.webapp.data;

import javax.jdo.annotations.*;

/*
 * Intrinsic properties of a user, verified on login.
 * A User object is never sent to the web client.
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class User {
	@SuppressWarnings("unused")
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long key;
	
	/*
	 * National registry number.
	 */
    @Persistent
    private Long nrn;
    
    /*
     * Password that can be used for login.
     */
    @Persistent
	private String password;
    
    /*
     * Profile associated to this user.
     */
    @Persistent
    private UserProfile profile = null;
	
	public User(Long nrn, String password) {
		this.nrn = nrn;
		this.password = password;
	}
	
	public Long getNrn() {
		return nrn;
	}
	
	public void setNrn(Long nrn) {
		this.nrn = nrn;
	}
	
	public String getPassword() {
		return password;
	}
	
	public void setPassword(String password) {
		this.password = password;
	}
	
	public UserProfile getProfile() {
		return profile;
	}
	
	public void setProfile(UserProfile profile) {
		this.profile = profile;
	}
}
